<template>
    <div class="maxBox">
        <div>
        <p>{{articalTitle}}</p>
        <input type="text" v-model="articalTitle">
        <input type="text" v-model="articalDescription">
        <input type="text" v-model="draftContent">
        <input type="button" @click="updateDraft" value="修改">
        </div>
    </div>
</template>
<script>
export default {
    data(){
        return{
            articalTitle:'',
            articalDescription:'',
            draftContent:''
        }
    },
    methods:{
        updateDraft(){
            this.$router.push({path:"/myBlog/draftBox",query:{
                _id:this.$route.query.aa,
                title:this.articalTitle,
                description:this.articalDescription,
                draftContent:this.draftContent
            }})
            //console.log(this.articalDescription)
        }
    },
    mounted:function(){
        this.$axios.get('/api/myBlog/editDraft',{
            params:{
                _id:this.$route.query.aa
            }
        }).then(res=>{
            var ret=res.data[0];
            this.articalTitle=ret.title;
            this.articalDescription=ret.description;
            this.draftContent=ret.draftContent
            //console.log(ret.title)
            //let keyindex=this.$route.query.aa;

        }),
        this.$axios.get("https://route.showapi.com/1211-1?count=10&showapi_appid=366761&showapi_timestamp=20200926110449&showapi_sign=57c366934f2c8472eafb2488aea13158").then(res=>{
            console.log(res.data)
        }).catch(err=>{
            console.log(err)
        })
    },
    
}
</script>
<style scoped>
.maxBox{
    display: flex;
    justify-content: center;
    align-items: center;
}
.maxBox p{
    font-size: 30px;
    color:white;
    text-align: center;
}
.maxBox input{
    width: 300px;
    height: 50px;
    border:none;
    display: block;
    background-color: transparent;
    border-bottom: 2px solid aqua;
    margin-top:50px;
    color:white;
}
.maxBox input[type=button]{
    width: 300px;
    height: 50px;
    border:none;
    display: block;
    background-color: aqua;
    margin-top:50px;
    color:white;
}
</style>